//
//  TaskHeadView.m
//  NoneCar
//
//  Created by DongSen on 2018/7/16.
//  Copyright © 2018年 董森森. All rights reserved.
//

#import "TaskHeadView.h"

@implementation TaskHeadView

+ (TaskHeadView*)loadView{
    NSArray * viewArray =[[NSBundle mainBundle] loadNibNamed:@"TaskHeadView" owner:self options:nil];
    TaskHeadView * view  = [viewArray firstObject];
    [view.sortingButton setTitleColor:APPGaryColor forState:UIControlStateNormal];
    [view.screeningButton setTitleColor:APPGaryColor forState:UIControlStateNormal];
    return view;
}

-(void)setSortString:(NSString *)sortString{
    if ([sortString isEqualToString:@"排序"]) {
        self.sortLabel.textColor = APPGaryColor;
        self.sortImageView.image = [UIImage imageNamed:@"灰色"];
    }
    else{
        self.sortLabel.textColor = APPColor;
        self.sortImageView.image = [UIImage imageNamed:@"下蓝"];
    }
    _sortString = sortString;
    self.sortLabel.text = sortString;

}
-(void)setSortShowing:(BOOL)sortShowing{
    if (sortShowing) {
        self.sortImageView.image = [UIImage imageNamed:@"上蓝"];
    }
    else{
        self.sortImageView.image = [UIImage imageNamed:@"下蓝"];
    }
    _sortShowing = sortShowing;
}

-(void)setScreenShowing:(BOOL)screenShowing{
    if (screenShowing) {
        self.screenImageView.image = [UIImage imageNamed:@"上蓝"];
    }
    else{
        self.screenImageView.image = [UIImage imageNamed:@"下蓝"];
    }
    _screenShowing = screenShowing;
}

-(void)setScreenString:(NSString *)screenString{
    if ([screenString isEqualToString:@"状态筛选"]) {
        self.screenLabel.textColor = APPGaryColor;
        self.screenImageView.image = [UIImage imageNamed:@"灰色"];
    }
    else{
        self.screenLabel.textColor = APPColor;
        self.screenImageView.image = [UIImage imageNamed:@"下蓝"];
    }
    _screenString = screenString;
    self.screenLabel.text = screenString;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
